import time
from video_gen import video_template
import logging
import random
from jdbc.connector import connect_fetch


def job():
    try:
        # # 支持的模板
        # template_ids = [51, 47, 4, 54, 16]
        # # 无文案模板
        # parm_no = [51, 47]
        # # 文案支持的模板编号
        # sql_number = connect_fetch()
        # for item in sql_number:
        #     parm_no.extend(item)
        # supported_templates = list(set(parm_no) & set(template_ids))
        # template_id = random.choice(supported_templates)
        # print(f"template code：{template_id},execute Time(yyyy-mm-dd h:m:s):",
        #       time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
        video_template(51)
    except Exception as e:
        logging.error(f"定时任务执行失败：{str(e)}")
    finally:
        print("#########################END##################################################")


if __name__ == '__main__':
    print('1')
